import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/Home.vue'

//设置页面和收藏页面的引用
import Collection from "../views/collection/Collection";
import Seting from "../views/seting/Seting";
//设置页面内的组件引用
import Account from "../views/seting/components/Account";
import Found from "../views/found/Found";
import Login from "../views/login/Login";
import Mypage from "../views/mypage/Mypage";
//王菲的路径
import Quest from "../views/quest/Quest";
import Recommend from "../views/recommend/Recommend";
import Person from "../views/person/Person";
import CreativeCenter from "../views/creativecenter/CreativeCenter";
import NewQuest from "../views/newquest/NewQuest";
import QuestInvite from "../views/questinvite/QuestInvite";
import Whome from "../views/creativecenter/components/Whome";
import WactiveCenter from "../views/creativecenter/components/WactiveCenter";
import QuestRecommend from "../views/creativecenter/components/QuestRecommend";
import childquestrecommend from "../views/questrecommend/childquestrecommend";
import requestfor from "../views/questrecommend/components/requestfor";
import questnew from "../views/questrecommend/components/questnew";
import questplan from "../views/questrecommend/components/questplan";
import upload from "../views/creativecenter/components/upload";

//
import Gerenziliao from "../views/gerenziliao/Gerenziliao";

import Recom from "../views/recom/Recom";
import Concern from "../views/concern/Concern";
import Hot from "../views/hot/Hot";
//hot下
import Both from "../views/hot/components/Both";
import HVideo from "../views/hot/components/HVideo";
import Science from "../views/hot/components/Science";
import Digit from "../views/hot/components/Digit";
import Fashion from "../views/hot/components/Fashion";
import Sports from "../views/hot/components/Sports";
import Car from "../views/hot/components/Car";

//
import Dongtai from "../views/dongtai/Dongtai";
import Answer from "../views/answer/Answer";
import Video from "../views/video/Video";
import Tiwen from "../views/tiwen/Tiwen";
import Article from "../views/article/Article";
import Column from "../views/column/Column";
import Idea from "../views/idea/Idea";
import Collect from "../views/collect/Collect";
import Attention from "../views/attention/Attention";

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: Login
  },
  {
    path: '/home',
    name: 'Home',
    component: Home,
    children:[
       { path: '/', name: 'Recom', component: Recom},
       { path: '/concern', name: 'Concern', component: Concern,},
       { path: '/hot', name: 'Hot', component: Hot,
         // redirect:'/HVideo',
         children:[

           { path: '/hot/Both', name: 'Both', component: Both},
           { path: '/hot/HVideo', name: 'HVideo', component: HVideo},
           { path: '/hot/Science', name: 'Science', component: Science},
           { path: '/hot/Digit', name: 'Digit', component: Digit},
           { path: '/hot/Sports', name: 'Sports', component: Sports},
           { path: '/hot/Fashion', name: 'Fashion', component: Fashion},
           { path: '/hot/Car', name: 'Car', component: Car},
         ]
       },
    ]
  },
  {
    path: '/found',
    name: 'Found',
    component: Found
  },{
    path: '/gerenziliao',
    name: 'Gerenziliao',
    component: Gerenziliao,
  },
  {
    path: '/collection',
    name: 'Collection',
    component: Collection
  },{
    path: '/seting',
    name: 'Seting',
    component: Seting,
  },
  {
    path: '/mypage',
    name: 'Mypage',
    component: Mypage,
    children:[
      { path: '/dongtai', name: 'Dongtai', component: Dongtai},
      { path: '/answer', name: 'Answer', component: Answer},
      { path: '/video', name: 'Video', component: Video},
      { path: '/tiwen', name: 'tiwen', component: Tiwen},
      { path: '/article', name: 'article', component: Article},
      { path: '/column', name: 'column', component: Column},
      { path: '/idea', name: 'idea', component: Idea},
      { path: '/collect', name: 'collect', component: Collect},
      { path: '/attention', name: 'attention', component: Attention},
    ]
  },
  {
    path: '/quest',
    name: 'Quest',
    component: Quest,
    children:[
      { path: '/', name: 'Recommend', component: Recommend},
      { path: '/person', name: 'Person', component: Person},
      { path: '/newquest', name: 'NewQuest', component: NewQuest},
      { path: '/questinvite', name: 'QuestInvite', component: QuestInvite},
    ]
  },
  {
    path: '/creativecenter',
    name: 'CreativeCenter',
    component: CreativeCenter,
    redirect:'/whome',
    children:[
      { path: '/whome', name: 'Whome', component: Whome},
      { path: '/creativecenter/WactiveCenter', name: 'WactiveCenter', component: WactiveCenter},
      { path: '/creativecenter/QuestRecommend', name: 'QuestRecommend', component: QuestRecommend,
        redirect:'/childquestrecommend',
        children:[
          { path: '/childquestrecommend', name: 'childquestrecommend', component: childquestrecommend},
          { path: '/questrecommend/requestfor', name: 'requestfor', component: requestfor},
          { path: '/questrecommend/questnew', name: 'questnew', component: questnew},
          { path: '/questrecommend/questplan', name: 'questplan', component: questplan}
        ]},
      { path: '/creativecenter/components', name: 'upload', component: upload},
    ]
  },




]

const router = new VueRouter({
  mode:'history',
  routes
})

export default router
